// Copyright (C) 2021 Focus Media Holding Ltd. All Rights Reserved.

package cn.focusmedia.central.${appCode}.app.convert;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import cn.focusmedia.central.${appCode}.client.dto.${modelPackName}.${className}DTO;
import cn.focusmedia.central.${appCode}.client.dto.${modelPackName}.${className}QueryDTO;
import cn.focusmedia.central.${appCode}.domain.${modelPackName}.domainobject.${className};
import cn.focusmedia.central.${appCode}.domain.${modelPackName}.domainobject.query.${className}Query;
import cn.focusmedia.fdf.common.convert.BaseDTOConvert;

/**
 * ${className}DTOConvert
 *
 * @author ${author}
* @since ${date}
 **/
@Component
public class ${className}DTOConvert extends BaseDTOConvert<${className}, ${className}DTO> {

    @Override
    public ${className}DTO domain2DTO(${className} source) {
        ${className}DTO target = new ${className}DTO();
        if (null != source) {
            BeanUtils.copyProperties(source, target);
        }
        return target;
    }

    @Override
    public ${className} dto2Domain(${className}DTO source) {
        ${className} target = new ${className}();
        if (null != source) {
            BeanUtils.copyProperties(source, target);
        }
        return target;
    }

    public ${className}Query convertDTO2Query(${className}QueryDTO source) {
        ${className}Query target = new ${className}Query();
        if (null != source) {
            BeanUtils.copyProperties(source, target);
        }
        return target;
    }

}
